﻿<UserControl x:Class="ClientCenter.SWAllUpdatesGrid"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="850">
    <Grid>
        <DockPanel>
            <DockPanel DockPanel.Dock="Top"  Height="32">
                <ToolBar Name="toolBar1">
                    <Button ToolTip="Reload all updates..." Name="bt_Reload" Click="bt_Reload_Click">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SCCMCliCtrWPF;component/Images/shell32.dll_I0017_0409.ico"/>
                            <TextBlock Margin="2,0,0,0">Reload Updates </TextBlock>
                        </StackPanel>
                    </Button>
                    <Separator />
                    <Button ToolTip="Filter only missing updates (no reload)" Name="bt_ReloadMissing" Click="bt_ReloadMissing_Click">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SCCMCliCtrWPF;component/Images/shell32.dll_I0017_0409.ico"/>
                            <TextBlock Margin="2,0,0,0">Show missing updates</TextBlock>
                        </StackPanel>
                    </Button>
                    <Separator />
                    <Button ToolTip="Install all required Updates" Name="bt_InstallAll" Click="bt_InstallAll_Click">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SCCMCliCtrWPF;component/Images/Import%20File.ico"/>
                            <TextBlock Margin="2,0,0,0">Install all required</TextBlock>
                        </StackPanel>
                    </Button>
                    <Separator />
                    <Button ToolTip="Open C:\Windows\WindowsUpdate.log" Name="bt_OpenUpdateLog" Click="bt_OpenUpdateLog_Click">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SCCMCliCtrWPF;component/Images/Search File.ico"/>
                            <TextBlock Margin="2,0,0,0">Open WindowsUpdate.log</TextBlock>
                        </StackPanel>
                    </Button>
                    <Button ToolTip="Hide duplicates" Name="bt_Filter">
                        <StackPanel Orientation="Horizontal">
                            <CheckBox Name="cb_Filter" IsChecked="True" Checked="cb_Filter_Checked" Unchecked="cb_Filter_Unchecked">Hide duplicates</CheckBox>
                        </StackPanel>
                    </Button>
                </ToolBar>
             </DockPanel>
            <DockPanel DockPanel.Dock="Top">
                <DataGrid AutoGenerateColumns="False" HorizontalAlignment="Stretch" Name="dataGrid1" VerticalAlignment="Stretch" LoadingRow="dataGrid1_LoadingRow" IsReadOnly="True">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Article" Binding="{Binding Path=Article}" SortDirection="Ascending"  />
                        <DataGridTextColumn Header="Bulletin" Binding="{Binding Path=Bulletin}" />
                        <DataGridTextColumn Header="Language" Binding="{Binding Path=Language}"  />
                        <DataGridTextColumn Header="RevisionNumber" Binding="{Binding Path=RevisionNumber}" />
                        <DataGridTextColumn Header="ScanTime" Binding="{Binding Path=ScanTime, StringFormat='yyyy-MM-dd HH:mm:ss'}"/>
                        <DataGridTextColumn Header="SourceVersion" Binding="{Binding Path=SourceVersion}"/>
                        <DataGridTextColumn Header="Status" Binding="{Binding Path=Status}"/>
                        <DataGridTextColumn Header="Title" Binding="{Binding Path=Title}"/>
                        <DataGridTextColumn Header="UniqueID" Binding="{Binding Path=UniqueId}" DisplayIndex="9" Visibility="Hidden"/>
                        <DataGridTextColumn Header="ProductID" Binding="{Binding Path=ProductID}" DisplayIndex="10" Visibility="Hidden"/>
                        <DataGridTemplateColumn Header="" IsReadOnly="True" CanUserReorder="False" CanUserResize="False" CanUserSort="False" DisplayIndex="0">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Image Name="img" Source="/SCCMCliCtrWPF;component/Images/Software update.gif" Height="16"></Image>
                                    <DataTemplate.Triggers>
                                        <DataTrigger Binding="{Binding Status}" Value="Missing">
                                            <Setter TargetName="img" Property="Source" Value="/SCCMCliCtrWPF;component/Images/Invalid software update.gif"/>
                                        </DataTrigger>
                                    </DataTemplate.Triggers>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                    </DataGrid.Columns>
                    <!--<DataGrid.ContextMenu>
                        <ContextMenu>
                            <MenuItem Name="miInstallUpdate" Header="Install" Click="miInstallUpdate_Click">
                                <MenuItem.Icon>
                                    <Image Source="/SCCMCliCtrWPF;component/Images/Play.ico" Height="24" />
                                </MenuItem.Icon>
                            </MenuItem>
                        </ContextMenu>
                    </DataGrid.ContextMenu>-->
                </DataGrid>
            </DockPanel>
        </DockPanel>
    </Grid>
</UserControl>
